<?php 

require '../Yls/Core/Client.php';

$id = 'web';
$key = '29d03b2cd1df263770ead73c6e541322';
$url = 'http://yls.focrs.com/demo/index.php';
$version = '1.0';

$client = new Yls\Core\Client($url, $id, $key, $version);

/*
list($result) = $client->Query([
    'api' => 'user/2:delete'
]);
var_dump($result); die;
*/
/*
list($result) = $client->Query([
    'api' => 'user/1:update',
    'param' => ['nick' => '叶绿素']
]);
var_dump($result); die;
*/
/*
list($result) = $client->Query([
    'api' => 'user:create',
    'param' => [
        'name' => 'Focrs',
        'password' => '******',
        'nick' => '狐思',
        'created' => '{NOW()}'
    ]
]);
echo '<pre>';print_r($result);die;
*/

list($user) = $client->Query([
    'api' => 'user/page:Read',
    'param' => ['a' => 'xxx'],
    'page' => 1,
    'size' => 10
]);

echo '<pre>';print_r($user);
/*
list($result, $_) = $client->Query([
    'api' => 'user/1:read',
    'bind' => ['::name' => '.name']
], [
    'version' => '3.0',
    'api' => 'Search:Read',
    'param' => ['query' => '::name']
]);
*/
die;
echo '<pre>';print_r($result);die;